<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>对象继承</title>
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="author" content="尹学江">
  <!-- 人构造函数 -->
  <script type="text/javascript" src="person.js"></script>
  <!-- 学生的构造函数 -->
  <script type="text/javascript" src="student.js"></script>
</head>

<body>
<script type="text/javascript">
var p1 = new Person("张小宝",1);
p1.name = "张大宝";
console.log(p1.sleep(20));
console.log(p1.eat("牛奶"));

console.log( p1 instanceof Person);

var s1 = new Student("李学生",22);
console.log(s1.sleep(8));
console.log(s1.eat("肉和菜"));
console.log(s1.study(7,"html5课程"));

console.log(s1 instanceof Person)
console.log(s1 instanceof Object)
console.log(p1 instanceof Student)
console.dir(s1)
	
</script>
</body>
</html>